﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using SSLVerifier.API.ModelObjects;

namespace SSLVerifier.API.MainLogic {
	static class Tools {
		public static MessageBoxResult MsgBox(string header, string message, MessageBoxButton buttons, MessageBoxImage icon) {
			return MessageBox.Show(message, header, buttons, icon);
		}
		public static void SaveArrayAsCSV(IEnumerable<ServerObject> servers, String fileName) {
			using (StreamWriter file = new StreamWriter(fileName)) {
				file.WriteLine("Name,Port,Subject,NotBefore,NotAfter,Status");
				foreach (ServerObject server in servers) {
					file.WriteLine(server.ToString());
				}
			}
		}
	}
}
